import React, { Component } from 'react';
import { get } from 'utils/http'
import { ForyouWrap } from './styledIndex'

class Foryou extends Component {
    state = {
        list: []
    }
    async componentDidMount() {
        let result = await get({
            url: '/api/Show/Search/getShowList?city_id=0&page=2&version=6.0.9&referer=2'
        })

        this.setState({
            list: result.data.list
        })
    }
    render() {
        return (
            <ForyouWrap>
                <div className="head">
                    <header>热门场馆</header>
                    <span>></span>
                </div>
                <div className="main">
                    {
                        this.state.list.length && (
                            this.state.list.map( (value,index) => (
                                <div key={index} className="hhh">
                                    <img src={value.pic} alt=""/>
                                    <div className="jjj">
                                        <div>{value.start_show_time.substring(0,4)}&nbsp;{value.show_time_top}&nbsp;{value.show_time_bottom}</div>
                                        <div>{value.name}</div>
                                        <div>{value.city_name}&nbsp;|&nbsp;{value.venue_name}</div>
                                        <div>
                                            {
                                                value.support_desc.length && (
                                                    value.support_desc.map((item,index) => (
                                                        <span key={index}>{item}</span>
                                                    ))
                                                )
                                            }
                                        </div>
                                        <div>￥{value.min_price}&nbsp;<span>起</span></div>
                                    </div>
                                </div>
                            ) )
                        )
                    }
                </div>
            </ForyouWrap>
        );
    }
}

export default Foryou;